# Termination Condition
# 0! = 1

# Formula
# 1! = 1 * 0!
# 2! = 2 * 1!
# 3! = 3 * 2!
# 4! = 4 * 3!
# 5! = 5 * 4!
# ...
# n! = n * (n - 1)!

def factorial(n):
  if n == 0:
    return 1
  
  return n * factorial(n - 1)

print(factorial(4))

# 4 * factorial(3)
# 4 * 3 * factorial(2)
# 4 * 3 * 2 * factorial(1)
# 4 * 3 * 2 * 1 * factorial(0)
# 4 * 3 * 2 * 1 * 1 = 24